-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
app: eth2wrap best selector refactoring #2806
Conversation
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2806 +/- ##
=======================================
Coverage 53.27% 53.27%
=======================================
Files 199 199
Lines 27627 27624 -3
=======================================
Hits 14717 14717
+ Misses 11089 11083 -6
- Partials 1821 1824 +3 ☔ View full report in Codecov by Sentry. |
func (multi) Name() string { | ||
return "eth2wrap.multi" | ||
} | ||
|
||
func (m multi) Address() string { | ||
return m.clients[m.selector.Best()].Address() | ||
address, ok := m.selector.BestAddress() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In what case could BestAddress
return ok == false
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In theory this should never happen, because even after period
elapsed, we always add at least one entry to the map. So, this is a safeguard in case somebody changes the logic in Increment
and not look into this function.
A quick refactor of eth2wrap to avoid panic() call, to remove extra loops and to remove ambiguity around address<->index translation.
category: refactor
ticket: none